<template>
  <view class="sys">
    <view class="card">
      <view @click="toPath(0)" v-if="false">
        <text>更换手机号</text>
        {{ mobile }}
        <image
          src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61ab188e1f655f0011bbaece/61e7d9270c0e3200129ec72c/16425844611732717437.png"
        />
      </view>
      <view @click="toPath(1)">
        <text>关于我们</text
        ><image
          src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61ab188e1f655f0011bbaece/61e7d9270c0e3200129ec72c/16425844611732717437.png"
        />
      </view>
      <view @click="toPath(2)" v-if="false">
        <text>注销账号</text
        ><image
          src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/61ab188e1f655f0011bbaece/61e7d9270c0e3200129ec72c/16425844611732717437.png"
        />
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      mobile: "",
    };
  },
  onLoad() {
    this.init();
  },
  methods: {
    init() {
      // 获取个人信息
      this.$http.post("api/user/userInfo").then((res) => {
        for (let i in res) {
          if (i === "unpaid_order") {
            if (res[i] && JSON.stringify(res[i]) !== "{}") {
              this[i] = res[i];
            }
          } else {
            this[i] = res[i];
          }
        }
      });
    },
    toPath(index) {
      let url =
        index === 1
          ? "/addPage/pages/about"
          : index === 2
          ? "/addPage/pages/logout"
          : "/addPage/pages/changeTel";
      uni.navigateTo({
        url,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.sys {
  padding: 23rpx 30rpx;
  .card {
    background-color: white;
    border-radius: 28rpx;
    padding: 0 30rpx;
    view {
      height: 100rpx;
      border-bottom: 2rpx solid rgba(245, 245, 245, 1);
      display: flex;
      align-items: center;
      color: #333333;
      font-size: 30rpx;
      text {
        flex: 1;
      }
      image {
        width: 32rpx;
        height: 32rpx;
      }
    }
  }
}
</style>
